using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class 事件管理单例<T> : MonoBehaviour where T : 事件管理单例<T>
{
    public static T SingleEventManage;

    protected virtual void Awake()
    {
        if (SingleEventManage != null)
        {
            Debug.Log(name + "事件管理单例");
            Destroy(gameObject);
        }
        SingleEventManage = (T)this;
        DontDestroyOnLoad(gameObject);
    }
    protected virtual void OnDestroy()
    {
        SingleEventManage = null;
    }


}